package dao.impl;

import dao.ProjectDao;
import entry.PROJECT;
import util.DBHelper;

import java.util.ArrayList;

public class ProjectDaoImpl implements ProjectDao {
    DBHelper dbHelper = new DBHelper();
    @Override
    public int selectProjectByName(String projectName) {
        String sql ="select project.PID,PNAME,EXECUTOR,DESCRIPTION,ORDERLEVEL,CREATEDATE from project LEFT OUTER JOIN workorder ON project.PID = workorder.PID where PNAME=?";
        ArrayList query = dbHelper.query(sql, PROJECT.class);
        return (int) query.get(0);
    }
}
